

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Senarai Laporan</title>
        <link rel="stylesheet" href="styles/jquery.jgrowl.css" type="text/css"/>
        <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
        <script type="text/javascript" src="js/jquery.jgrowl.js"></script>
        <script type="text/javascript" src="pub/js/clear-text.js"></script>
        <script type="text/javascript" src="pub/js/jquery.form.js"></script>
        <script type="text/javascript">           
             
            function doWrite(event)  {
                frm = document.laporan;
                var queryString = $(frm).formSerialize();
                var url = frm.action + '?' + event + '&' + queryString;
                window.open(url, 'JAKOA', "status=0,toolbar=0,location=0,menubar=0,width=850,height=600,scrollbars=yes");
            }
                
        </script>
    </head>
    <body>
         <%@ include file="/WEB-INF/jsp/include/sidebar_admin.jsp" %>
         <div class="main_right">

        <s:form beanclass="com.jkoa.stripes.action.LaporanActionBean" name="laporan">
            <fieldset class="aras1">
                  <div class="left_entry"><div class="left_title">Senarai Laporan</div>
                    <table width="100%" border="0"  bordercolor="#BBB">
                        <tr><th class="left_title">Perkara</th><th class="left_title">Maklumat</th></tr>
                        <tr><td>Jenis Laporan :</td>
                            <td>
                                <s:select name="negeri" id="negeri" >
                                    <s:option value="0">Pilih ...</s:option>
                                    <s:option value="1">Laporan Majikan</s:option>
                                    <s:option value="2">Laporan Perkerja</s:option>
                                </s:select>
                            </td></tr>
                        <tr><td>Negeri :</td>
                            <td>
                                <s:select name="negeri" id="negeri" >
                                    <s:option value="0">Pilih ...</s:option>
                                    <s:option value="1">Selangor</s:option>
                                </s:select>
                            </td></tr>

                        <tr><td>Daerah :</td>
                            <td>
                                <s:select name="daerah" id="daerah">
                                    <s:option value="0">Pilih ...</s:option>
                                    <s:option value="1">Klang</s:option>
                                </s:select>
                            </td></tr>

                        <tr><td>Nama Majikan</td>
                            <td class="s">
                                <s:text name="namaMajikan" size="50"/>
                            </td></tr>
                        <tr><td>Bilangan Pekerja :</td>
                            <td class="s">
                                <s:text name="bilPekerja"/>
                            </td></tr>
                        <tr><td colspan="3">
                                <div align="center">
                                    <s:submit name="search" value="Cari" class="btn" />
                                    <s:button name="reset" value="Isi Semula"/>
                                </div>
                            </td></tr>
                    </table>
                </div>
            </fieldset>
            <c:if test="${actionBean.flag}">
                <fieldset class="aras1">
                    
                      <div class="left_entry"><div class="left_title">Senarai Majikan</div>
                        <display:table class="tablecloth" style="width:100%; border:0px;  bordercolor:#BBB;" name="${actionBean.senaraiMajikan}" pagesize="10"
                                       cellpadding="0" cellspacing="0" id="line"
                                       requestURI="/laporan">
                            <display:column title="Bil" sortable="true" style="vertical-align:baseline">${line_rowNum}</display:column>
                            <display:column property="namaMajikan" 
                                            title="Nama Majikan<input type='checkbox' checked id='semua' name='header_nama_majikan' value='namaMajikan'/>" style="vertical-align:baseline"/>
                            <display:column property="bilPekerja" title="Bilangan Pekerja<input type='checkbox' checked id='semua' name='header_bil_pekerja' value='bilPekerja'/>" style="vertical-align:baseline"/>
                            <display:column title="Alamat<input type='checkbox' id='semua' name='header_alamat' checked value='1'/>" style="vertical-align:baseline">
                                <c:if test="${!empty line.alamatMajikan1}">
                                ${line.alamatMajikan1}<br/>
                                </c:if>
                                 <c:if test="${!empty line.alamatMajikan2}">
                                ${line.alamatMajikan2}<br/>
                                </c:if>
                                <c:if test="${!empty line.alamatMajikan3}">
                                ${line.alamatMajikan3}<br/>
                                </c:if>
                                <c:if test="${!empty line.alamatMajikan4}">
                                ${line.alamatMajikan4}<br/>
                                </c:if>
                                ${line.alamatDaerah}<br/>
                                ${line.alamatPoskod}<br/>
                                ${line.alamatNegeri.nama}                            
                            </display:column>
                            <display:column title="Senarai Pekerja<input type='checkbox' id='semua' name='header_pekerja' checked value=1/>" style="vertical-align:baseline">
                                <c:forEach items="${line.senaraiPekerja}" var="pekerja">
                                    ${pekerja.peribadiPK.idPguna.nama} &nbsp;${pekerja.noPengenalan}<br/>
                                </c:forEach>
                            </display:column>
                        </display:table>
                        <c:if test="${!empty actionBean.senaraiMajikan}">
                            <a href="#" onclick="doWrite('convertToExcel');return false;">Excel</a> |
                            <a href="#" onclick="doWrite('convertToPdf');return false;">PDF</a>
                        </c:if>
                    </div>
                </fieldset>
            </c:if>
        </s:form>
             </div>
    </body>
</html>
